<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title></title>
	<include file="Public/header" />
</head>
<body>
<style>
.datagrid-cell, .datagrid-cell-group, .datagrid-header-rownumber, .datagrid-cell-rownumber{
	-o-text-overflow: ellipsis;
	text-overflow: ellipsis;
}
</style>
<script type="text/javascript">
	var getarrivalUrl="{:U('Ems/get_ems')}";
	var examineUrl="{:U('Ems/get_examine')}";
	var emsDelUrl="{:U('Ems/emsDel')}";
	var emsfeeUrl="{:U('Ems/emsfee')}";// 账册管理
	<!-- using('../../../default/js/emscompany.js'); -->
	var excelUrl="{:U('Import/importEms')}";
	var emsid;
    //搜索
    function emsSearch(value,name){
        if(value==''){
            $.messager.alert('搜索提示','搜索内容不能为空!','error');
        }else{
            var searchName=$.trim($('#emssearchInput').searchbox('getName'));
            var searchValue=$.trim($('#emssearchInput').searchbox('getValue'));
			
            switch(searchName){
                case 'code':
                    $('#emsDatagrid').datagrid({ queryParams:{code:searchValue}});
                    break;
                case 'name':
                    $('#emsDatagrid').datagrid({ queryParams:{name:searchValue}});
                    break;
            }
        }
    }
</script>
<script type="text/javascript" src="__PUBLIC__/Admin/lib/layer/1.9.3/layer.js"></script>
<script type="text/javascript" src="__PUBLIC__/default/js/emscompany.js"></script>

	<table id="emsDatagrid" toolbar="#ems_tb"></table>
	<!-- 添加 -->
    <div id="emsAddDialog" class="easyui-dialog" style="width:400px;padding:10px 20px"
            closed="true" buttons="#emsAddButtons"  modal="true">
        <form id="emsAddForm" method="post" novalidate>          
            <div class="fitem">
                <label>公司编号</label>
                <input name="code" class="easyui-textbox" data-options="required:true,delay:1000,height:30,validType:['length[1,20]']" />
            </div>
            <div class="fitem">
                <label>公司名称</label>
                <input name="name" id="name" type="text"  class="easyui-textbox" data-options="required:true,delay:1000,height:30,validType:['length[1,20]']" />
            </div>
			<div class="fitem">
                <label>域名URL</label>
                <input name="url"  type="text"  class="easyui-textbox" data-options="required:true,delay:1000,height:30" />
            </div> 
			<div class="fitem">
                <label>重量段(kg)</label>
                <input name="weight"  type="text"  class="easyui-textbox" data-options="required:true,delay:1000,height:30" />
            </div> 
			<div class="fitem">
                <label>备注</label>
                <input name="text"  type="text"  class="easyui-textbox" data-options="delay:1000,height:100,multiline:true" />
            </div>	
        </form>
    </div>
    <div id="emsAddButtons">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onclick="emsObj.add('{:U('Ems/emsAdd')}')" style="width:90px">添加</a>
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:
    $('#emsAddDialog').dialog('close')" style="width:90px">取消</a>
    </div>
    <!-- /添加 -->
	<!-- 编辑 -->
    <div id="emsEditDialog" class="easyui-dialog" style="width:400px;padding:10px 20px"
            closed="true" buttons="#emsEditButtons"  modal="true">
        <form id="emsEditForm" method="post" novalidate>          
            <div class="fitem">
                <label>公司编号</label>
                <input name="id"  type="hidden" />
                <input name="code"  type="text" class="easyui-textbox" data-options="disabled:true,required:true,delay:1000,height:30,validType:['length[1,20]']" />
            </div>
            <div class="fitem">
                <label>公司名称(同一快递名称在快递名后加编号：如 中通-1)</label>
                <input name="name"  type="text"  class="easyui-textbox" data-options="required:true,delay:1000,height:30,validType:['length[1,20]']" />
            </div> 
			<div class="fitem">
                <label>域名URL</label>
                <input name="url"  type="text"  class="easyui-textbox" data-options="required:true,delay:1000,height:30" />
            </div>
			<div class="fitem">
                <label>重量段(kg)</label>
                <input name="weight"  type="text"  class="easyui-textbox" data-options="required:true,delay:1000,height:30" />
            </div>
			<div class="fitem">
                <label>商家编码(多个用半角,分割)</label>
                <input name="merchant_code"  type="text"  class="easyui-textbox" data-options="delay:1000,height:30" />
            </div>
			<div class="fitem">
                <label>默认快递</label>
                是<input name="default_status"  type="radio" value="1" style="width:20px" />
				否<input name="default_status"  type="radio" value="0" style="width:20px" />
            </div>
			<div class="fitem">
                <label>备注</label>
                <input name="text"  type="text"  class="easyui-textbox" data-options="delay:1000,height:100,multiline:true" />
            </div>			
        </form>
    </div>
    <div id="emsEditButtons">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onclick="emsObj.save('{:U('Ems/emsSave')}')" style="width:90px">更新</a>
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:
    $('#emsEditDialog').dialog('close')" style="width:90px">取消</a>
    </div>
    <!-- /编辑 -->  
    <!-- 搜索栏 -->
    <div id="ems_tb">
        <form id="emsSearchForm" method="post" novalidate>
             <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon icon-all" plain="true" onclick="emsObj.showAll()">全部</a>     
            <input id='emssearchInput' class="easyui-searchbox" data-options="height:30,menu:'#emsSearchbox',searcher:emsSearch"  style="width:300px"/>
            <div id="emsSearchbox">
                <div data-options="name:'code',iconCls:'icon icon-msn'">公司编号</div>
                <div data-options="name:'name',iconCls:'icon-email'">公司名称</div>
            </div>
        </form>
		<a href="javascript:void(0)" onclick="emsObj.excelBar()" class="easyui-linkbutton" data-options="iconCls:'icon-page_excel',plain:true">导入</a>
		<a href="javascript:void(0)" onclick="emsObj.infoBar()" class="easyui-linkbutton" data-options="iconCls:'icon-application_form',plain:true">费用模板</a>
		<a href="javascript:void(0)" onclick="emsObj.addBar()" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">添加</a>
        <a href="javascript:void(0)" onclick="emsObj.editBar()" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true">修改</a>
        <a href="javascript:void(0)" onclick="emsObj.removeBar()" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true">删除</a>
        <a href="javascript:void(0)" onclick="emsObj.examineBar(1)" class="easyui-linkbutton" data-options="iconCls:'icon-key',plain:true">审核通过</a>
		<a href="javascript:void(0)" onclick="emsObj.examineBar(2)" class="easyui-linkbutton" data-options="iconCls:'icon-key_delete',plain:true">审核不通过</a>
    </div>
    <!-- /搜索栏 -->
</body>